package com.xpgk.mvc.boutStorage;

import java.util.List;

import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.tx.Tx;
import com.xpgk.mvc.base.BaseController;
import com.xpgk.mvc.codeSet.Code;
import com.xpgk.mvc.productOutin.ProductOutin;

public class BoutStorageController extends  BaseController{
	
	
	private BoutStorageServices boutStorageServices;
	public  void  index()
	{
		render("BoutStorage.html");
	}
	public  void   getPersion()
	{
		String sql=getSqlMy(Code.sqlId_child);
		List<Code>  codeList=Code.dao.find(sql,Code.ckyy_ids);
		renderJson(codeList);
	}
	
	
	/**保存产品出库
	 * 
	 */
	@Before(Tx.class)
	public  void  saveBoutStorage()
	{	
		
		String  boutDate=getPara("boutDate");
		List<ProductOutin> poList = getModels(ProductOutin.class);
		//获取当前登录机构id
		String  orgids=getCUserOrganIds();
		//获取当前登陆人员id
		String  userids=getCUserIds();
		
		
		String msg=boutStorageServices.saveBoutStorage(poList,orgids,userids,boutDate);
		renderText(msg);
	}
	
	
	
}
